using System;
using CodePlex.DnD4eCampaignManager.DnD4e;
using CodePlex.DnD4eCampaignManager.DnD4e.Interfaces;
using NUnit.Framework;

namespace CodePlex.DnD4eCampaignManager.CampaignManagerTests.DnD4eTests
{
    [TestFixture]
    public class MovementTests
    {
        [Test]
        public void HasMovementSpeed()
        {
            const int speed = 6;
            Movement movement = new Movement { MovementSpeed = speed };
            Assert.AreEqual(speed, movement.MovementSpeed);
        }

        [Test]
        public void HasMovementSpeedOther()
        {
            const string speedOther = "climb 4";
            Movement movement = new Movement { MovementSpeedOther = speedOther };
            Assert.AreEqual(speedOther, movement.MovementSpeedOther);
        }

        [Test]
        public void HasMovementStealth()
        {
            const int stealth = 6;
            Movement movement = new Movement { MovementStealth = stealth };
            Assert.AreEqual(stealth, movement.MovementStealth);
        }

        [Test]
        public void ImplementsIEquatable()
        {
            Assert.IsInstanceOfType(typeof ( IEquatable<Movement> ), new Movement());
        }

        [Test]
        public void ImplementsIMovement()
        {
            Assert.IsInstanceOfType(typeof ( IMovement ), new Movement());
        }

        [Test]
        public void IsEquatable()
        {
            Movement primaryDomainObject = new Movement { MovementSpeed = 6 };
            Movement duplicateDomainObject = new Movement { MovementSpeed = 6 };
            Movement differentDomainObject = new Movement { MovementSpeed = 8 };

            TestHelpers.TestEquatabilityExcludingOperators(primaryDomainObject, duplicateDomainObject, differentDomainObject);
            Assert.IsTrue(primaryDomainObject == duplicateDomainObject);
            Assert.IsTrue(primaryDomainObject != differentDomainObject);
        }
    }
}